package edu.avans.hartigehap.domain;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;

@Entity
//optional
public class InternetBill extends Bill
{
	private static final long serialVersionUID = 1L;
	private Restaurant restaurant;

	public InternetBill(){
		
	}
	
	public InternetBill(Discount discount)
	{
		super(discount);
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	public Restaurant getRestaurant() {
		return restaurant;
	}

	public void setRestaurant(Restaurant restaurant) {
		this.restaurant = restaurant;
	}
	

	public void submitOrder() throws StateException, EmptyBillException {
		currentOrder.submit();
		submit();
	}
}
